var url = 'http://47.108.197.28:4000/api/article';
$ajax({
    url,
    success:res=>{
        var result = res.res;
        result.forEach(item => {
            var {avatar,date,title,imgSrc,content,collectNum,reading} = item;
            var template=`
            <div class="xcontainer">
            <div class="content">
                <div><img src="${avatar}" alt=""><span>${date}</span></div>
                <div><h3>${title}</h3></div>
                <div><img src="${imgSrc}" alt=""></div>
                <div>${content}</div>
                <div>评论:${collectNum} 看过: ${reading}</div>
            </div>
            </div>
            `
            $(".container").append(template)
        });
    }
})